<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>商品列表</title>

		<link rel="stylesheet" href="/manager/style/css/screen.css"
			type="text/css" media="screen, projection" />

		<link rel="stylesheet" type="text/css"
			href="/manager/style/css/superfish.css" media="screen">

		<script type="text/javascript"
			src="/manager/style/js/jquery-1.4.2.min.js">

</script>

		<script type="text/javascript">
jQuery(function($) {
	
	//验证分页页脚跳转框的输入正误
	$("#curPage_id").change(function() {

		var num = $(this).val();
		if ( isNaN ( num ) || num < 1 || num > <s:property value="totalPage"/>) {
			$(this).val(1);
		}
	});
});
</script>

		<style type="text/css">
.page_foot {
	
}

.page_foot a,.page_foot span {
	height: 24px;
	margin-right: 5px;
	padding: 0 4px 0 6px;
	line-height: 24px;
}

.page_foot span {
	border: solid 1px #c3d9ff;
	background: #c3d9ff;
}

.page_foot a {
	border: solid 1px #c3d9ff;
	background: #ccc;
	text-decoration: none;
	color: #000;
}

.page_foot a:hover {
	background: #aaa;
	color: #fff;
}

.page_foot form {
	float: right;
	line-height: 24px;
}
</style>


	</head>

	<body>

		<div class="right_context container">
			<div class="span-16">

				<fieldset>
					<legend>
						商品列表
					</legend>
					<table class="span-15">
						<thead>
							<tr>
								<th class="span-3">
									商品分类
								</th>
								<th class="span-4">
									商品名称
								</th>
								<th class="span-1">
									成本
								</th>
								<th class="span-1">
									售价
								</th>
								<th class="span-1">
									库存
								</th>
								<th class="span-1">
									上架
								</th>
								<th class="span-2">
									发布者
								</th>
								<th class="span-2 last">
									操作
								</th>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="goodsList" var="g">
								<tr>
									<td>
										<s:iterator value="naviList" var="n">
											<s:if test="%{#n.type == 'goods'}">
												<s:if test="%{#n.keyString == #g.naviKey}">
													<input type="hidden" name="goods.naviKey"
														value="<s:property value="#n.keyString" />" />
													<s:property value="#n.displayName" />
												</s:if>
											</s:if>
										</s:iterator>
									</td>

									<td>
										<s:property value="#g.displayName" />
									</td>

									<td>
										<s:property value="#g.costPrice" />
									</td>

									<td>
										<s:property value="#g.price" />
									</td>

									<td>
										<s:property value="#g.stocks" />
									</td>

									<td>
										<s:if test="%{#g.boolShelve}">
											<input type="checkbox" name="goods.boolShelve" value="true"
												checked="checked" style="display: none" />
									是
							</s:if>
										<s:else>
											<input type="checkbox" name="goods.boolShelve" value="true"
												style="display: none" />否
							</s:else>
									</td>

									<td>
										<s:property value="#g.postUserName" />
									</td>


									<td>
										<a
											href="/manager/goods-toUpdate.action?id=<s:property value="#g.id"/>">修改</a>|
										<a
											href="/manager/goods-deleteGoods.action?id=<s:property value="#g.id"/>">删除</a>
									</td>
								</tr>

							</s:iterator>
						</tbody>


						<tfoot>
							<tr>
								<td colspan="8">
									<div class="page_foot">
										<s:iterator value="pageList" var="p">
											<s:if test="%{#p.boolDisplay}">
												<a
													href="/manager/goods-manager.action?<s:property value="#p.url"/>"><s:property
														value="#p.displayName" /> </a>
											</s:if>
											<s:else>
												<span><s:property value="#p.displayName" /> </span>
											</s:else>
										</s:iterator>
										共
										<s:property value="totalPage" />
										页
										<form action="/manager/goods-manager.action" method="post">
											<input type="submit" value="跳转至" />
											<input id="curPage_id" type="text" name="curPage" value="1"
												style="width: 24px;" />
											页
										</form>
									</div>

								</td>
							</tr>
						</tfoot>

					</table>

				</fieldset>

			</div>
		</div>
	</body>

</html>
